<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>

    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
    <table border="1px" cellspacing="0px" align="center" width="400px">
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>成绩</th>
        </tr>
        <tr v-for="(emp, index) in emps">
            <td align="center">{{index+1}}</td>
            <td align="center">{{emp.name}}</td>
            <td align="center">{{emp.age}}</td>
            <td align="center" v-if="emp.gender == 1">男</td>
            <td align="center" v-if="emp.gender == 2">女</td>
            <td align="center">{{emp.score}}</td>
        </tr>
    </table>
</div>
</body>
<script>
    new Vue({
        el:"#app",
        data:{
            emps:[]
        },
        mounted() {
            axios.get("/requestList").then((result) => {
                if(result.data.code){
                    this.emps = result.data.data
                }
            });

        },
        methods: {

        },
    });
</script>
</html>